/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.expert.entity.SolutionFaceAndProduct;

/**
 * 面部护理方案与产品关系DAO接口
 * @author lvbo
 * @version 2013-06-08
 */
public interface SolutionFaceAndProductDao extends SolutionFaceAndProductDaoCustom, CrudRepository<SolutionFaceAndProduct, Long> {

	@Query("from SolutionFaceAndProduct where SOLUTION_ID = ?1 AND PRODUCT_ID = ?2")
	public SolutionFaceAndProduct findByPKId(Long solutionId, Long productId);
	
	@Query("from SolutionFaceAndProduct where SOLUTION_ID = ?1")
	public List<SolutionFaceAndProduct> findBySolutionId(Long solutionId);
	
	@Query("from SolutionFaceAndProduct where PRODUCT_ID = ?1")
	public List<SolutionFaceAndProduct> findByProductId(Long productId);
}

/**
 * DAO自定义接口
 * @author lvbo
 */
interface SolutionFaceAndProductDaoCustom extends BaseDao<SolutionFaceAndProduct> {

}

/**
 * DAO自定义接口实现
 * @author lvbo
 */
@Component
class SolutionFaceAndProductDaoImpl extends BaseDaoImpl<SolutionFaceAndProduct> implements SolutionFaceAndProductDaoCustom {

}
